package de.mafr.jsystest.ws.json;

import net.sf.json.JSON;
import de.mafr.jsystest.SystemTestConfig;
import de.mafr.jsystest.ws.AbstractWebService;
import de.mafr.jsystest.ws.Request;
import de.mafr.jsystest.ws.Response;


public class JsonWebService extends AbstractWebService<JSON> {
	private static final String CONTENT_TYPE = "application/json";
	private static final String CONTENT_ENCODING = "UTF-8";

	public JsonWebService(SystemTestConfig config) {
		super(new JsonResponseFactory(), config);
	}

	public Response<JSON> post(String uri, JSON content) {
		return post(uri, new Request<JSON>(content, CONTENT_TYPE, CONTENT_ENCODING));
	}
	
	public Response<JSON> put(String uri, JSON content) {
		return put(uri, new Request<JSON>(content, CONTENT_TYPE, CONTENT_ENCODING));
	}
}
